package fun.codedesign.datasource.example.controller;


import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import fun.codedesign.datasource.example.domain.Person;
import fun.codedesign.datasource.example.service.PersonService;

@RestController
public class DatasourceController {

    private final PersonService personService;

    public DatasourceController(PersonService personService) {
        this.personService = personService;
    }

    @GetMapping("/list")
    public List<Person> getList() {
        List<Person> list = personService.getList();
        return personService.getList();
    }
}
